<?php

namespace App\Providers;

use App\Models\ItemCateModel;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\View;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //
    }

    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        View::composer('layout.header', function ($view) {
            $memus = ItemCateModel::where('pid', 2)->get(['name', 'id']);
            $variable =$memus;
            $view->with('sharedVariable', $variable);
        });
    }
}
